package com.eleven.mall.controller;

import com.eleven.mall.pojo.DataOut;
import com.eleven.mall.pojo.Rbody;
import com.eleven.mall.service.DataService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: Rui_simple
 * @Date: 2022/10/25 21:32
 * @Description: DataController
 * @Version 1.0.0
 */
@RestController
@AllArgsConstructor
@CrossOrigin
public class DataController {

    DataService dataService;

    @GetMapping("/reports/type/1")
    public Rbody dataChart(){
        Rbody rbody = new Rbody();
        DataOut dataOut = dataService.getEChart();
        rbody.setData(dataOut);
        return rbody;
    }
}
